home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.19950528-19950726
/
000095_news@columbia.edu_Fri Jun 9 15:35:39 1995.msg
< prev
next >
Wrap
Internet Message Format
|
1995-07-31
|
2KB
Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA14738
(5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Fri, 9 Jun 1995 11:35:50 -0400
Received: by apakabar.cc.columbia.edu id AA24432
(5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Fri, 9 Jun 1995 11:35:49 -0400
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: String manipulations
Date: 9 Jun 1995 15:35:39 GMT
Organization: Columbia University, New York City
Lines: 31
Message-Id: <3r9pob$nr8@apakabar.cc.columbia.edu>
References: <3r7lcl$956@feenix.metronet.com>
Nntp-Posting-Host: watsun.cc.columbia.edu
Apparently-To: kermit.misc@watsun.cc.columbia.edu
In article <3r7lcl$956@feenix.metronet.com>,
Brit Systems <brit@metronet.com> wrote:
>What calls are there to parse a string?
>Like I need to get the filename out of a fully qualified filename.
>
>getfilename C:/SOME/DUMB.FIL
>will provide DUMB.FIL
>
>It's gotta be easy, but I can't find it.
>
When posting questions like this to (as Pnews would say) "the entire
civilized world", it's always a good idea to make your posting as
useful as possible -- in this case by specifying which software and
version you are talking about. Let's assume you are using MS-DOS
Kermit 3.14 (not earlier) or C-Kermit 5A(190). In that case, the
answer is yes. Read about the string functions in the KERMIT.UPD
file that comes on the MS-DOS Kermit 3.14 diskette, or in the book
"Using C-Kermit".
Here, for example, is a (perhaps not totally straightforward) trick for
getting the "basename" from a DOS file specification, which is in the
variable \%f:
asg \%f \\\%f ; Prepend a backslash
asg \%9 \freverse(\%f) ; Reverse the string
asg \%8 \findex(\,\%9,1) ; Find first backslash
decrement \%8 ; Length of string before backslash
asg \%9 \fsubstr(\%9,1,\%8) ; Extract it
asg \%9 \freverse(\%9) ; Unreverse it
- Frank